﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using FazaDemo.PL.AbstractPresenters;
using FazaDemo.PL.Wpf;
using FazaDemo.ViewModels;
using FazaDemo.BL.AppFacade;
using FazaDemo.BL.InterfaceDomain;

namespace FazaDemo.PL.Wpf.Browser
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {

        protected override void OnStartup(StartupEventArgs e)
        {
            //base.OnStartup(e);
            var factory = new WorkAreaFactory();
            var basePresenter = new BasePresenter(factory);
            IMenuReceiver receiver = new MenuReceiver();
            IEnumerable<Menu_Item> menuItems = receiver.GetMenuItems();
            IWorkAreaViewModel viewModel = new WorkAreaViewModel { Items = menuItems };
            var presenter = new WorkAreaPresenter(basePresenter, viewModel);
            Page workArea = presenter.Initialize();
            workArea.BeginInit();
            presenter.BuildElements(workArea);
            workArea.EndInit();
        }

    }
}
